<template>
  <div>
    <el-form :model="dataForm" ref="dataForm" label-width="80px">
      <el-form-item label="菜单图标" prop="icon">
        <el-row>
          <el-col :span="22">
            <el-popover
              ref="iconListPopover"
              placement="bottom-start"
              trigger="click"
              popper-class="mod-menu__icon-popover"
            >
              <icon-svg @iconSelect="iconSelect"></icon-svg>
            </el-popover>
            <el-input
              v-model="dataForm.icon"
              v-popover:iconListPopover
              :readonly="true"
              placeholder="菜单图标名称"
              class="icon-list__input"
            ></el-input>
          </el-col>

          <el-col :span="2" class="icon-list__tips">
            <el-tooltip placement="top" effect="light">
              <div slot="content">
                文档：<a
                  href="https://blog.csdn.net/qq_40323256/article/details/116950679"
                  target="_blank"
                  >icons/index.js</a
                >描述
              </div>
              <i class="el-icon-warning"></i>
            </el-tooltip>
          </el-col>
        </el-row>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import IconSvg from "@/components/icon-svg/index.vue";
export default {
  components: { IconSvg },
  data() {
    return {
      dataForm: {},
    };
  },
  methods: {
    // 图标选中
    iconSelect(iconName) {
      this.$set(this.dataForm, "icon", iconName);
    },
  },
};
</script>

<style scoped>
 .icon-list__input >>> .el-input__inner{
  cursor: pointer ;
}
</style>